﻿@using Entity.ProjectEnt
@using ZFine.Domain.Entity
@{
    PositionRecordEntity thisposition = ViewData["thispos"] as PositionRecordEntity;
    if (thisposition == null)
    {
        thisposition = new PositionRecordEntity();

    }
    if (thisposition.DispatcherUser == null)
    {
        thisposition.DispatcherUser=new UserEntity();
    }
    if (thisposition.DiaochezhangUser == null)
    {
        thisposition.DiaochezhangUser = new UserEntity();
    }
    if (thisposition.TougouyuanUser == null)
    {
        thisposition.TougouyuanUser = new UserEntity();
    }
    if (thisposition.ZhongzhuanyuanUser == null)
    {
        thisposition.ZhongzhuanyuanUser = new UserEntity();
    }
    if (thisposition.SijiUser == null)
    {
        thisposition.SijiUser = new UserEntity();
    }
    if (thisposition.FusijiUser == null)
    {
        thisposition.FusijiUser = new UserEntity();
    }
    if (thisposition.HuoyunyunaUser1 == null)
    {
        thisposition.HuoyunyunaUser1 = new UserEntity();
    }
    if (thisposition.HuoyunyunaUser2 == null)
    {
        thisposition.HuoyunyunaUser2 = new UserEntity();
    }
    if (thisposition.daokouyuanUser1 == null)
    {
        thisposition.daokouyuanUser1 = new UserEntity();
    }
    if (thisposition.daokouyuanUser2 == null)
    {
        thisposition.daokouyuanUser2 = new UserEntity();
    }
    Dictionary<string,List<UserEntity>> thisuserandpotion= ViewData["thisuserandpotion"] as Dictionary<string, List<UserEntity>>;
}
<script>
    //$(function () {
    //        $.ajax({
    //            url: "/SystemManage/User/GetPosition",
    //            data: { keyValue: "" },
    //            dataType: "json",
    //            async: false,
    //            success: function (data) {
    //                $("#form").formSerialize(data);
    //            }
    //    });
    //    $("#login_button1").click(function() {
    //        alert("不修改");
    //    });
      

    //});
    function notmodifpost() {
        window.location.href = "/Home/Index";
    }
    function modifpost() {
        debugger;
       var TougouyuanUser = $("#TougouyuanUser").val();
        var DispatcherUser = $("#DispatcherUser").val();
        var DiaochezhangUser = $("#DiaochezhangUser").val();
        var ZhongzhuanyuanUser = $("#ZhongzhuanyuanUser").val();
        var SijiUser = $("#SijiUser").val();
        var FusijiUser = $("#FusijiUser").val();
        var HuoyunyunaUser1 = $("#HuoyunyunaUser1").val();
        var HuoyunyunaUser2 = $("#HuoyunyunaUser2").val();
        var daokouyuanUser1 = $("#daokouyuanUser1").val();
        var daokouyuanUser2 = $("#daokouyuanUser2").val();
        var banciUser = $("#BanciUser").val();
        debugger;
        //var personpostiton = {
        //    ProductionUser: {
        //        F_Id: ProductionUser
        //    },
        //    DispatcherUser: {
        //        F_Id: DispatcherUser
        //    },
        //    DiaochezhangUser: {
        //        F_Id: DiaochezhangUser
        //    },
        //    SijiUser: {
        //        F_Id: SijiUser
        //    },
        //    FusijiUser: {
        //        F_Id: FusijiUser
        //    },
        //    HuoyunyunaUser1: {
        //        F_Id: HuoyunyunaUser1
        //    },
        //    HuoyunyunaUser2: {
        //        F_Id: HuoyunyunaUser2
        //    },
        //    daokouyuanUser1: {
        //        F_Id: daokouyuanUser1
        //    },
        //    daokouyuanUser2: {
        //        F_Id: daokouyuanUser2
        //    },
        //    BanciUser: banciUser
        //}
                $.ajax({
                    url: "/SystemManage/User/Updateposition",
                    data: { TougouyuanUser: TougouyuanUser, DispatcherUser: DispatcherUser, DiaochezhangUser: DiaochezhangUser, ZhongzhuanyuanUser: ZhongzhuanyuanUser, SijiUser: SijiUser, FusijiUser: FusijiUser, HuoyunyunaUser1: HuoyunyunaUser1, HuoyunyunaUser2: HuoyunyunaUser2, daokouyuanUser1: daokouyuanUser1, daokouyuanUser2: daokouyuanUser2,BanCiUser: banciUser },
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        if (data.code == -1) {
                            alert(data.message);
                        } else {
                            alert(data.message);
                            window.setTimeout(function () {
                                window.location.href = "/Home/Index";
                            }, 500);
                        }
                        //$("#form").formSerialize(data);
                    }
            });
        debugger;
    };
  
</script>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新畅铁路后台管理系统</title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-login.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <script src="~/Content/js/cookie/jquery.cookie.js"></script>
    <script src="~/Content/js/md5/jquery.md5.js"></script>
    
    

    <style>
        .dl:hover {
            color: aqua;
        }
        .form-control {
            display: block;
            width: 100%;
            height: 34px;
            padding: 6px 12px;
            font-size: 14px;
            line-height: 1.42857143;
            color: #555;
            background-color: #fff;
            background-image: none;
            border: 1px solid #ccc;
            border-radius: 4px;
            -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
            box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
            -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
            -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
            transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
        }
    </style>
    <!--[if lte IE 8]>
        <div id="errorie"><div>您还在使用老掉牙的IE，正常使用系统前请升级您的浏览器到 IE8以上版本 <a target="_blank" href="http://windows.microsoft.com/zh-cn/internet-explorer/ie-8-worldwide-languages">点击升级</a>&nbsp;&nbsp;强烈建议您更改换浏览器：<a href="http://down.tech.sina.com.cn/content/40975.html" target="_blank">谷歌 Chrome</a></div></div>
    <![endif]-->
   
</head>
<body>
    <div style="position: absolute; z-index: 999; top: 20px; left: 20px; color: #fff; font-size: 13px; line-height: 22px;">
        @*用户名 admin 或 guest，密码 0000，请勿在系统内发表不文明信息*@
    </div>
    <div class="wrapper">
        <div class="container">
            <div class="logo" style="margin-left: -120px;padding-bottom: 100px !important;">
                <i class="fa fa-modx"></i>
                <h1><span>排车管理</span></h1>
            </div>
            <form class="form" style=" width: 650px; height: 620px; margin-left:-100px">
                @*<div class="row">
                    <div style="display:inline-block;">生产部长：</div>
                    <select id="ProductionUser" name="ProductionUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display: inline-block; width: 200px;">
                        @{
                            List<UserEntity> tempshengchan = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("生产部长", out tempshengchan);
                            if (tempshengchan != null && tempshengchan.Count > 0)
                            {
                                foreach (var item in tempshengchan)
                                {
                                   <option value="@item.F_Id" @(thisposition.ProductionUser.F_Id==item.F_Id?"selected=\"selected\"":"") >@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>*@
                <div class="row">
                    <div style="display:inline-block;">调 度 员&nbsp;：</div>
                    <select id="DispatcherUser" name="DispatcherUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> diaoduyuan = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("调度员", out diaoduyuan);
                            if (diaoduyuan != null && diaoduyuan.Count > 0)
                            {
                                foreach (var item in diaoduyuan)
                                {
                                    <option value="@item.F_Id" @(thisposition.DispatcherUser.F_Id==item.F_Id?"selected=\"selected\"":"") >@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">调 车 长  ：</div>
                    <select id="DiaochezhangUser" name="DiaochezhangUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> diaochezhang = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("调车长", out diaochezhang);
                            if (diaochezhang != null && diaochezhang.Count > 0)
                            {
                                foreach (var item in diaochezhang)
                                {
                                    <option value="@item.F_Id" @(thisposition.DiaochezhangUser.F_Id==item.F_Id?"selected=\"selected\"":"") >@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">头 钩 员  ：</div>
                    <select id="TougouyuanUser" name="TougouyuanUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> tougouyuan = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("头钩员", out tougouyuan);
                            if (tougouyuan != null && tougouyuan.Count > 0)
                            {
                                foreach (var item in tougouyuan)
                                {
                                    <option value="@item.F_Id" @(thisposition.TougouyuanUser.F_Id==item.F_Id?"selected=\"selected\"":"") >@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">中 转 员  ：</div>
                    <select id="ZhongzhuanyuanUser" name="ZhongzhuanyuanUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> zhongzhuanyuan = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("中转员", out zhongzhuanyuan);
                            if (zhongzhuanyuan != null && zhongzhuanyuan.Count > 0)
                            {
                                foreach (var item in zhongzhuanyuan)
                                {
                                    <option value="@item.F_Id"@(thisposition.ZhongzhuanyuanUser.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">&nbsp;司 &nbsp;&nbsp; 机  ：</div>
                    <select id="SijiUser" name="SijiUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> siji = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("司机", out siji);
                            if (siji != null && siji.Count > 0)
                            {
                                foreach (var item in siji)
                                {
                                    <option value="@item.F_Id" @(thisposition.SijiUser.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">副 司 机 ：</div>
                    <select id="FusijiUser" name="FusijiUser.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> fusiji = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("副司机", out fusiji);
                            if (fusiji != null && fusiji.Count > 0)
                            {
                                foreach (var item in fusiji)
                                {
                                    <option value="@item.F_Id" @(thisposition.FusijiUser.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">货 运 员  ：</div>
                    <select id="HuoyunyunaUser1" name="HuoyunyunaUser1.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> huoyunyuan1 = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("货运员", out huoyunyuan1);
                            if (huoyunyuan1 != null && huoyunyuan1.Count > 0)
                            {
                                foreach (var item in huoyunyuan1)
                                {
                                    <option value="@item.F_Id" @(thisposition.HuoyunyunaUser1.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                    <select id="HuoyunyunaUser2" name="HuoyunyunaUser2.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;margin-left: 35px;">
                        @{
                            List<UserEntity> huoyunyuan2 = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("货运员", out huoyunyuan2);
                            if (huoyunyuan2 != null && huoyunyuan2.Count > 0)
                            {
                                foreach (var item in huoyunyuan2)
                                {
                                    <option value="@item.F_Id" @(thisposition.HuoyunyunaUser2.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                
                <div class="row">
                    <div style="display:inline-block;">道 口 员 ：</div>
                    <select id="daokouyuanUser1" name="daokouyuanUser1.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px;">
                        @{
                            List<UserEntity> daokouyuan1 = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("道口员", out daokouyuan1);
                            if (daokouyuan1 != null && daokouyuan1.Count > 0)
                            {
                                foreach (var item in daokouyuan1)
                                {
                                    <option value="@item.F_Id" @(thisposition.daokouyuanUser1.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                    <select id="daokouyuanUser2" name="daokouyuanUser2.F_Id" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;width: 200px; margin-left: 35px;">
                        @{
                            List<UserEntity> daokouyuan2 = new List<UserEntity>();
                            thisuserandpotion.TryGetValue("道口员", out daokouyuan2);
                            if (daokouyuan2 != null && daokouyuan2.Count > 0)
                            {
                                foreach (var item in daokouyuan2)
                                {
                                    <option value="@item.F_Id" @(thisposition.daokouyuanUser2.F_Id==item.F_Id?"selected=\"selected\"":"")>@item.F_RealName</option>
                                }
                            }
                        }
                    </select>
                </div>
                <div class="row">
                    <div style="display:inline-block;">&nbsp;班 &nbsp;&nbsp; 次  ：</div>
                    <select id="BanciUser" name="BanciUser" class="form-control" style="margin-top: 10px; margin-bottom: 10px; display:inline-block;wid1th: 200px;">
                        <option value="甲" @(thisposition.BanciUser=="甲"?"selected=\"selected\"":"")>甲</option>
                        <option value="乙" @(thisposition.BanciUser=="乙"?"selected=\"selected\"":"")>乙</option>
                        <option value="丙" @(thisposition.BanciUser=="丙"?"selected=\"selected\"":"")>丙</option>
                    </select>
                </div>
                @*<div class="row">
            <input id="txt_password" type="password" placeholder="登录密码" value="0000">
            <i class="fa fa-key"></i>
        </div>*@
                @*<div class="row">
            <input id="txt_code" maxlength="4" type="text" placeholder="验证码" style="width: 190px; float: left;" value="11">
            <div style="width: 110px; float: right; padding-top: 14px; padding-left: 14px;">
                看不清？<a id="switchCode" href="javascript:void();" style="text-decoration: none;">换一张</a>
                <img id="imgcode" class="authcode" src="~/Login/GetAuthCode" width="80" height="25" />
            </div>
        </div>*@
                <div class="row">
                    <button id="Addpos_button" type="button" style="width: 270px;" onclick="modifpost()">修改提交</button>
                    <button id="login_button1" type="button" style="width: 270px;" onclick="notmodifpost()">暂不修改</button>
                </div>
                <div class="row">
                </div>
            </form>
            <div class="login_tips"></div>
        </div>
        <ul class="bg-bubbles">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    @*<div class="copyright">
        <a href="" style="text-decoration:none;color:#fff;">开发团队出品</a>
        <br>
        适用浏览器：IE8以上、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗.
    </div>*@
    <script type="text/javascript">
        (function ($) {
            $.login = {
                init: function () {
                    $('.wrapper').height($(window).height());
                    $(".container").css("margin-top", ($(window).height() - $(".container").height()) / 2 - 50);
                    $(window).resize(function (e) {
                        $('.wrapper').height($(window).height());
                        $(".container").css("margin-top", ($(window).height() - $(".container").height()) / 2 - 50);
                    });
                    $("#switchCode").click(function () {
                        $("#imgcode").attr("src", "/Login/GetAuthCode?time=" + Math.random());
                    });
                }
            };
            $(function () {
                $.login.init();
            });
        })(jQuery);

      
    </script>
</body>
</html>
